#ifndef UI_ANIM_GROUP_H_
#define UI_ANIM_GROUP_H_

#include <string>
#include "IO/TouchScreen/TouchScreenBase.h"

class UIAnimBG : public TouchScreenBase
{
public:
	UIAnimBG(const char *pSpriteName, int frameId, bool hasAnim = true);
	~UIAnimBG();
	void Update(float dt);
	void Render();

	virtual bool IsCreateProcessFinished();

	bool IsNormalProcessFinished();

	int m_offsetY;
	int m_color;

	void ChangeBG(const char *pSpriteName, int frameId);
private:
	void DrawMyAnim();
private:
	int m_frameId;
	bool m_isFrame;
	std::string m_name;

	bool m_hasAnim;

	irr::video::ITexture * m_pTexture;

	irr::video::SMaterial *m_pMaterial;
};

class UIAnimGroup : public TouchScreenBase
{
public:
	UIAnimGroup();
	~UIAnimGroup();

	void Add( TouchScreenBase * sub );

	void RemoveAll();

	void Update(float dt);

	virtual bool IsCreateProcessFinished();
	virtual bool IsExitProcessFinished();

	virtual void ChangeTouchState( E_TouchState state, TouchScreenBase * sub = NULL);

	virtual void Reset();
private:
	irr::core::array<TouchScreenBase *> m_allSub;
};

#endif//UI_ANIM_GROUP_H_